﻿@inject NavigationManager NavigationManager
@inject IHttpService _httpService

@if (!ToolHelper.IsSSR)
{
    <AuthorizeView>
        <Authorized>
            @{
                _httpService.IsAuth = true;
            }
            @ChildContent
        </Authorized>
    </AuthorizeView>
}


@code {
    [Parameter]
    public RenderFragment ChildContent { get; set; }

    [CascadingParameter]
    public ErrorHandler ErrorHandler { get; set; }

    protected override void OnAfterRender(bool firstRender)
    {
        if (firstRender)
        {
            if (ToolHelper.IsSSR)
            {
                //跳转
                NavigationManager.NavigateTo("https://app.cngal.org/" + NavigationManager.Uri.Replace(NavigationManager.BaseUri, ""));
            }

        }
    }
}
